home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr05 / wet101.zip / WET.DOC < prev    next >
Text File  |  1994-05-14  |  49KB  |  1,387 lines

  1.         
  2.                  (C) Copyright 1994  MaeDae Enterprises
  3.         
  4.         
  5.         
  6.         
  7.         
  8.         
  9.         
  10.         
  11.         
  12.         
  13.         
  14.         
  15.                W I N D O W S   E N C R Y P T I O N   T O O L K I T
  16.         
  17.                                      (W E T)
  18.         
  19.         
  20.         
  21.         
  22.                                   Version 1.xx
  23.         
  24.                                 Reference Manual
  25.         
  26.         
  27.         
  28.         
  29.         
  30.         
  31.         Windows Encryption Toolkit (WET) for Windows is provided as user
  32.          supported software (Shareware).  If you use it past the initial
  33.            15 day evaluation period, you are required to register it.
  34.         
  35.         
  36.         
  37.                                  WET for Windows
  38.         
  39.         
  40.         "Encryption and decryption toolkit -- Fast, secure, and easy to use"
  41.         
  42.         
  43.                                  is published by
  44.         
  45.                                MaeDae Enterprises
  46.                                  5430 Murr Road
  47.                           Peyton, CO 80831-7402  U.S.A.
  48.         
  49.                                  (719) 683-3860
  50.         
  51.         
  52.               Published and printed in the United States of America.
  53.         
  54.         Copyright 1994 by MaeDae Enterprises as a licensed, unpublished,
  55.               proprietary work.  All international rights reserved.
  56.         
  57.         
  58.         
  59.         
  60.         
  61.         
  62.         
  63.                                    Page 1
  64.         
  65.         
  66.         
  67.         
  68.                  (C) Copyright 1994  MaeDae Enterprises
  69.         
  70.         The printed Reference Manual and associated registered software
  71.         may not be copied, resold, reproduced, disclosed, archived,
  72.         transmitted, or transferred in any form, electronic or otherwise,
  73.         without the express written permission of MaeDae Enterprises.
  74.         You may freely distribute the Shareware version of WET.
  75.         Registered users may freely distribute WET's standard encryption
  76.         DLL with their products.  Export restrictions apply to WET Pro's
  77.         DES DLL.
  78.         
  79.         The WET DLLs provide the same quality encryption routines as
  80.         those we use in Encrypt-It for Windows and DOS.  These routines
  81.         have been tested by thousands of registered Encrypt-It users.  We
  82.         have recently provided these quality encryption/decryption
  83.         routines to the general public in the form of WET.  Please let us
  84.         know of other functions you would like us to provide.
  85.         
  86.         REGISTERED USERS:  (those who paid us for this product)
  87.         
  88.         MaeDae Enterprises hereby grants a "book" license to the original
  89.         individual (even if purchased by a company) user of this copy of
  90.         WET.  You may use this developer's toolkit on your computer and
  91.         make one backup for storage as long as there is no possibility of
  92.         use or residence on more than one machine at any time.  Just like
  93.         two people cannot read the same book in different locations at
  94.         the same time.  You may not sell or give copies of the registered
  95.         development files or printed documentation to anyone.
  96.         
  97.         You may include WET's encryption/decryption DLLs with any
  98.         products you develop without additional payment to us.  Please
  99.         note that you must restrict the distribution of any product that
  100.         contains WET Pro's DES DLL.
  101.         
  102.         Pricing, specifications, and conditions are subject to change
  103.         without notice.
  104.         
  105.         Send all registrations and inquiries for site (multiple CPU or
  106.         network) licensing to MaeDae Enterprises at the address on the
  107.         previous page.
  108.         
  109.         Disclaimer:
  110.         
  111.         MaeDae Enterprises makes NO claims AND offers NO warranties of
  112.         any sort with WET.  MaeDae Enterprises assumes NO
  113.         responsibility for any damage resulting from the apparent or
  114.         actual use of WET (mental or physical).  The WET toolkits are
  115.         not guaranteed as to merchantability or fitness for its ultimate
  116.         use.  The user accepts all responsibility for use and may not
  117.         resell the program.
  118.         
  119.         IBM PC/XT/AT are registered trademarks of the International
  120.         Business Machines Corporation.
  121.         
  122.         WET is a trademark of MaeDae Enterprises.  Other trademarks
  123.         belong to their respective owners.
  124.         
  125.         
  126.         
  127.         
  128.         
  129.                                    Page 2
  130.         
  131.         
  132.         
  133.         
  134.                  (C) Copyright 1994  MaeDae Enterprises
  135.         
  136.         PREFACE
  137.         
  138.         ABOUT THIS MANUAL
  139.         
  140.         You will notice that this manual is concise.  This is intentional
  141.         as we have tried to make WET the easiest toolkit of its type to
  142.         use.
  143.         
  144.         This manual provides information on both the WET Standard and WET
  145.         Professional version (WET Pro).  Please note that WET Pro
  146.         provides all the WET DLLs plus adds a DES DLL that is currently
  147.         export restricted. Purchasers of WET Pro will be able to
  148.         distribute DES enabled products for US and Canadian sales.  Our
  149.         standard encryption/decryption DLL (WETSTD.DLL) can be
  150.         distributed world-wide.
  151.         
  152.         For many of you, this may be your first exposure to Shareware. To
  153.         help eliminate possible confusion, we have included a short
  154.         description of the Shareware marketing concept, explaining what
  155.         it is and why it relies on YOU for its survival.
  156.         
  157.         What is Shareware?  Shareware is not a kind of software.  It is a
  158.         revolutionary method of marketing Commercial software.  Our
  159.         software is Commercial software that we are allowing you to
  160.         examine for 15 days before you make the purchase decision.  With
  161.         traditional marketing methods, you have to purchase Commercial
  162.         software from a computer store or through mail order businesses,
  163.         then try it out, and hope it does what you want.  Shareware
  164.         allows you to "try before you buy!"
  165.         
  166.         We rely upon you, the customer, to examine our software.  If you
  167.         find it useful, please register.  Your support is needed for us
  168.         to continue to improve our products.
  169.         
  170.         Enough of this verbage.  The real fun and learning begin when you
  171.         use this toolkit.  So, enjoy!
  172.         
  173.         With warmest regards,
  174.         
  175.         The gang at MaeDae Enterprises.
  176.         
  177.         
  178.         
  179.         
  180.         
  181.         
  182.         
  183.         
  184.         
  185.         
  186.         
  187.         
  188.         
  189.         
  190.         
  191.         
  192.         
  193.         
  194.         
  195.                                    Page 3
  196.         
  197.         
  198.         
  199.         
  200.                  (C) Copyright 1994  MaeDae Enterprises
  201.         
  202.                                    Table of Contents
  203.                                    =================
  204.         
  205.         Page    Description
  206.         ====    ============
  207.         
  208.         5.      What is WET?  An overview of its features.
  209.         
  210.         5.      What is WET Pro?  An overview of its features.
  211.         
  212.         6.      What is the Data Encryption Standard (DES)?
  213.         
  214.         7.      Hardware Requirements
  215.         
  216.         7.      Software Requirements
  217.         
  218.         7.      Installation - the "README.DOC" file
  219.         
  220.         8.      Installation Notes
  221.         
  222.         9.      Getting Started
  223.         
  224.         14.     How to use DLLs
  225.         
  226.         15.     Tutorial
  227.         
  228.         15.     Additional Features
  229.         
  230.         16.     Cryptographic Techniques
  231.         
  232.         19.     Encrypted Ramblings
  233.         
  234.         21.     Basic Definitions
  235.         
  236.         
  237.         
  238.         
  239.         
  240.         
  241.         
  242.         
  243.         
  244.         
  245.         
  246.         
  247.         
  248.         
  249.         
  250.         
  251.         
  252.         
  253.         
  254.         
  255.         
  256.         
  257.         
  258.         
  259.         
  260.         
  261.                                    Page 4
  262.         
  263.         
  264.         
  265.         
  266.                  (C) Copyright 1994  MaeDae Enterprises
  267.         
  268.         WHAT IS WET?
  269.         ============
  270.         
  271.         The Windows Encryption Toolkit (WET) is a powerful
  272.         encryption/decryption toolkit packaged as Dynamic Link Libraries
  273.         (DLLs) for Windows 3.0 or later that allows you to:
  274.         
  275.         1. Encrypt any data using the secure Data Encryption Standard
  276.         (Pro version),
  277.         
  278.         2. Decrypt the data using a confidential key,
  279.         
  280.         3. Perform encryption and decryption on both text and binary data
  281.         in a 8 byte block or entire blocks in-memory at a time,
  282.         
  283.         4. Use XOR, transpositon, substitution, Data Encryption Standard
  284.         (DES), or DES+cipher block chaining in any combination or number
  285.         of layers you want,
  286.         
  287.         5. Calculate cyclic redundancy checks (CRCs) to detect any
  288.         modifications to your data,
  289.         
  290.         6. Access our secure routines from almost any Windows based
  291.         language,
  292.         
  293.         7. And do it all without having to invest weeks or months
  294.         developing your own encryption routines!
  295.         
  296.         
  297.         WHAT IS WET PRO?
  298.         ================
  299.         
  300.         WET Professional version or WET Pro is the professional version
  301.         of WET.  It provides all the functions and DLLs of WET plus
  302.         provides DES and DES + cipher block chaining (CBC)
  303.         encryption/decryption functions.
  304.         
  305.         Our DES routines are based on DESNEW and are up to ten times
  306.         faster than most other DES routines.  Thanks to our high
  307.         performance and secure encryption/decryption functions, you can
  308.         have the latest in data protection without spending months to
  309.         develop them.
  310.         
  311.         
  312.         
  313.         
  314.         
  315.         
  316.         
  317.         
  318.         
  319.         
  320.         
  321.         
  322.         
  323.         
  324.         
  325.         
  326.         
  327.                                    Page 5
  328.         
  329.         
  330.         
  331.         
  332.                  (C) Copyright 1994  MaeDae Enterprises
  333.         
  334.         WHAT IS THE DATA ENCRYPTION STANDARD (DES)?
  335.         ===========================================
  336.         
  337.         Most encryption schemes are kept secret.  One exception is the
  338.         Data Encryption Standard (DES), which was issued by the U.S.
  339.         National Bureau of Standards.  The National Security Agency (NSA)
  340.         was intimately involved in the development and acceptance testing
  341.         of this algorithm.
  342.         
  343.         But, how does it work?  DES performs its encryption "magic" by
  344.         working on a block of 64 bits of your data using a 64 bit key
  345.         (we generate the 64 bit key from the key you supply).  Basically,
  346.         DES is a substitution cipher.  We know this sounds very technical,
  347.         but don't worry, we have hidden all the complexity of DES behind an
  348.         extremely easy to use interface.  Our simple and straight
  349.         forward encryption functions makes protecting your data a simple
  350.         task.  Technically, DES only uses the first 56 bits of your key.
  351.         There are several good cryptography books available that discuss
  352.         the details of DES.  We will leave the exact details of DES and
  353.         key length for more advanced reading on your part.  Check your
  354.         local large bookstore for suitable texts.
  355.         
  356.         Why did we choose to implement DES?  We chose DES because it is a
  357.         standard.  Its ability to protect your data is well documented.
  358.         Our goal is to provide you the best possible software tool for
  359.         the protection of your data.  We support multiple layers of
  360.         encryption, with DES as any layer of protection for your
  361.         data.  Because of this approach, we feel your data is protected
  362.         far better than using DES by itself.
  363.         
  364.         There has been some theoretical discussions recently centering
  365.         around whether it is just impossibily hard to break DES or
  366.         whether it could be broken given million dollar computers and
  367.         months or years of the computer's time.  Just to alleviate any
  368.         concern you might have in this area, we have added cipher block
  369.         chaining to WET Pro as an additional encryption layer that is
  370.         applied underneath DES.
  371.         
  372.         
  373.         
  374.         
  375.         
  376.         
  377.         
  378.         
  379.         
  380.         
  381.         
  382.         
  383.         
  384.         
  385.         
  386.         
  387.         
  388.         
  389.         
  390.         
  391.         
  392.         
  393.                                    Page 6
  394.         
  395.         
  396.         
  397.         
  398.                  (C) Copyright 1994  MaeDae Enterprises
  399.         
  400.         HARDWARE REQUIREMENTS
  401.         =====================
  402.         
  403.         1.  IBM PC/XT/AT, IBM PS/2, or fully compatible computer capable
  404.         of running Windows 3.0 or later.
  405.         
  406.         2.  At least one 5.25" or 3.5" floppy disk drive.  Two floppy disk
  407.         drives or one floppy and a hard disk (400K free space minimum for
  408.         the full system) are strongly recommended.
  409.         
  410.         
  411.         
  412.         SOFTWARE REQUIREMENTS
  413.         =====================
  414.         
  415.         1. A Windows based language that supports the use of DLLs.
  416.         
  417.         2. Windows 3.0 or later.
  418.         
  419.         3. EGA or better graphics adapter.
  420.         
  421.         
  422.         
  423.         INSTALLATION - README.DOC
  424.         =========================
  425.         
  426.         For all installation information see the README.DOC on the main
  427.         distribution diskette.  You can view the information on-line or
  428.         print it out on your printer.  README.DOC is constantly updated
  429.         to contain the latest information.
  430.         
  431.         Recently we have added an installation program to our shareware
  432.         distribution set of files.  Run INSTALL.EXE for a simplified
  433.         installation process.
  434.         
  435.         P.S. The Shareware version of WET is complete.  However,
  436.         it is a 15 day trial version.  Also, additional product
  437.         information screens may have been added.  Please note that we
  438.         can't provide the more powerful DES encryption routines for you to
  439.         review in the shareware version of WET due to DES export
  440.         restrictions.
  441.         
  442.         Feel free to share ONLY the Shareware version with friends and
  443.         potential users of WET for 15 day trial/evaluation
  444.         purposes only.  You may not use the Shareware version on other
  445.         machines in order to avoid purchasing additional copies of the
  446.         full program.  You may not give away any copies or make more than
  447.         one copy of the fully operational program for other than archival
  448.         purposes.
  449.         
  450.         
  451.         
  452.         
  453.         
  454.         
  455.         
  456.         
  457.         
  458.         
  459.                                    Page 7
  460.         
  461.         
  462.         
  463.         
  464.                  (C) Copyright 1994  MaeDae Enterprises
  465.         
  466.         IMPORTANT INSTALLATION NOTES:
  467.         
  468.         1.  Diskette #1 contains many files in addition to the standard
  469.         version of WET (WETSTD.DLL).  The professional version of
  470.         WET provides DES encryption (WETDES.DLL + WETSTD.DLL) plus all
  471.         the functions of the standard version (WETSTD.DLL).  Please make
  472.         sure these files are all installed in the same directory when
  473.         running an application that accesses the WET DLLs.
  474.         
  475.         2.  If WET does not run properly:
  476.         
  477.             A.  Your machine may not be 100% IBM PC operating system
  478.             compatible or Windows may be installed incorrectly.  This
  479.             is not always disastrous and a quick call to our phone
  480.             support staff may solve your problem.
  481.         
  482.             B.  You may have a slightly incompatible Windows video
  483.             driver.  Usually, updating your driver or re-installing
  484.             Windows solves the problem.  In some cases you may need to
  485.             delete Windows and re-install it.  The Windows installation
  486.             program doesn't always overwrite existing files.
  487.         
  488.             C.  If you have any memory resident programs or system
  489.             drivers, try running without them loaded on your computer.
  490.         
  491.         3.  This manual is designed to give you a general overview and
  492.         familiarity with our developer's toolkit.  Our encryption
  493.         routines are very straight forward and tend to be self
  494.         documenting.
  495.         
  496.         4.  We have included source code to show you how to interface
  497.         WET to some of the older existing software bases.  Inside of
  498.         MS_DEMO.ZIP you will find a simple example of using WET with
  499.         Microsoft C6/7.
  500.         
  501.         
  502.         
  503.         
  504.         
  505.         
  506.         
  507.         
  508.         
  509.         
  510.         
  511.         
  512.         
  513.         
  514.         
  515.         
  516.         
  517.         
  518.         
  519.         
  520.         
  521.         
  522.         
  523.         
  524.         
  525.                                    Page 8
  526.         
  527.         
  528.         
  529.         
  530.                  (C) Copyright 1994  MaeDae Enterprises
  531.         
  532.         GETTING STARTED
  533.         ===============
  534.         
  535.         The WET toolkit provides several different encryption
  536.         techniques for protecting your data.  Listed below is an overview
  537.         of the different functions in our toolkit.  We have provided
  538.         complete definitions of the functions.  Almost any computer
  539.         language for Windows should be able to call these DLLs using the
  540.         information listed below.
  541.         
  542.         
  543.         Functions provided using the standard version of WET
  544.         (WETSTD.DLL):
  545.         
  546.         
  547.         
  548.         VOID FAR PASCAL EncryptXORBlock(unsigned char far *block,
  549.           int block_length, unsigned char far *code_key);
  550.         
  551.             Where:  block - A far pointer to the data you want encrypted
  552.                     or decrypted.
  553.         
  554.                     block_length - The number of bytes to encrypt or
  555.                                    decrypt at the location pointed to
  556.                                    by block.
  557.         
  558.                     code_key - A far pointer the zero terminated string
  559.                                that is to be used to encrypt or decrypt
  560.                                the block data.
  561.         
  562.         
  563.         
  564.         VOID FAR PASCAL EncryptTranspositionBlock(unsigned char far *block,
  565.           int block_length, unsigned char far *code_key);
  566.         
  567.             Where:  block - A far pointer to the data you want encrypted
  568.                             or decrypted.
  569.         
  570.                     block_length - The number of bytes to encrypt or
  571.                                    decrypt at the location pointed to
  572.                                    by block.
  573.         
  574.                     code_key - A far pointer the zero terminated string
  575.                                that is to be used to encrypt or decrypt
  576.                                the block data.
  577.         
  578.             Note:  This encryption technique is especially strong.  Your
  579.                    code_key is used as the seed into a pseudo-random
  580.                    number generator which generates a greatly expanded
  581.                    key of between 1000 and 2000 bytes long using only
  582.                    lengths that are prime numbers (ex: 1009, 1999, 1013,
  583.                    etc).  For short blocks this technique will provide you
  584.                    with a key longer than the block ensuring good
  585.                    protection.
  586.         
  587.         
  588.         
  589.         
  590.         
  591.                                    Page 9
  592.         
  593.         
  594.         
  595.         
  596.                  (C) Copyright 1994  MaeDae Enterprises
  597.         
  598.         
  599.         
  600.         VOID FAR PASCAL EncryptSubstitutionBlock(unsigned char far *block,
  601.           int block_length, unsigned char far *code_key);
  602.         
  603.             Where:  block - A far pointer to the data you want decrypted.
  604.         
  605.                     block_length - The number of bytes to encrypt or
  606.                                    decrypt at the location pointed to
  607.                                    by block.
  608.         
  609.                     code_key - A far pointer the zero terminated string
  610.                                that is to be used to encrypt the block
  611.                                data.
  612.         
  613.         
  614.         
  615.         unsigned int FAR PASCAL CRCBlock(unsigned char far *block,
  616.           int block_length);
  617.         
  618.             Where:  block - A far pointer to the data you want encrypted
  619.                             or decrypted.
  620.         
  621.                     block_length - The number of bytes to encrypt or
  622.                                    decrypt at the location pointed to
  623.                                    by block.
  624.         
  625.             Note: This function returns a 16 bit unsigned int which
  626.                   contains a 16 bit CRC for the data pointed to by the
  627.                   block far pointer.
  628.         
  629.         
  630.         
  631.         unsigned int FAR PASCAL GetVersionWETSTD(void);
  632.         
  633.             This function returns the current revision number of WET.
  634.             The format is to return the entire revision as an unsigned
  635.             integer.  For example:  v1.00 would be returned as 100.
  636.         
  637.         
  638.         
  639.         Additional functions provided with the professional version of
  640.         WET (WETSTD.DLL+WETDES.DLL) include:
  641.         
  642.         
  643.         
  644.         
  645.         VOID FAR PASCAL DESKeyloadEncrypt(unsigned char far *key);
  646.         
  647.             Where:  key - A far pointer to the eight byte block that
  648.                           contains the DES key for encryption.  This is
  649.                           binary data, no need for a zero terminated
  650.                           string.  You need to load the key once at the
  651.                           start of the encryption process.
  652.         
  653.         
  654.         
  655.         
  656.         
  657.                                    Page 10
  658.         
  659.         
  660.         
  661.         
  662.                  (C) Copyright 1994  MaeDae Enterprises
  663.         
  664.         VOID FAR PASCAL DESKeyloadDecrypt(unsigned char far *key);
  665.         
  666.             Where:  key - A far pointer to an eight byte block that
  667.                           contains the DES key for decryption.  This is
  668.                           binary data, no need for a zero terminated
  669.                           string.  You need to load the key once at the
  670.                           start of the decryption process.
  671.         
  672.         
  673.         VOID FAR PASCAL CryptDES(unsigned char far *datablock);
  674.         
  675.             Where:  datablock - A far pointer to an eight byte block that
  676.                                 is to be encrypted or decrypted in place.
  677.                                 The plain text data will be overwritten
  678.                                 by the encrypted version.
  679.         
  680.         
  681.         
  682.         VOID FAR PASCAL EncryptDESBlock(unsigned char far *block,
  683.           int block_length);
  684.         
  685.             Where:  block - A far pointer to the data you want encrypted.
  686.         
  687.                     block_length - The number of bytes to encrypt at the
  688.                                    location pointed to with block.
  689.         
  690.             Note:  DES works with 64 bits (8 bytes) of your data at one
  691.                    time.  We recommend additional steps if your block is
  692.                    not exactly an even multiple of 8 bytes long.  One
  693.                    approach to work around this limitation is to apply
  694.                    one of the conventional encryption methods such as
  695.                    transposition underneath the DES level of encryption.
  696.         
  697.         
  698.         
  699.         VOID FAR PASCAL DecryptDESBlock(unsigned char far *block,
  700.           int block_length);
  701.         
  702.             Where:  block - A far pointer to the data you want decrypted.
  703.         
  704.                     block_length - The number of bytes to decrypt at the
  705.                                    location pointed to with block.
  706.         
  707.         
  708.         
  709.         VOID FAR PASCAL EncryptDESBlockCBC(unsigned char far *block,
  710.           int block_length);
  711.         
  712.             Where:  block - A far pointer to the data you want encrypted.
  713.         
  714.                     block_length - The number of bytes to encrypt at the
  715.                                    location pointed to with block.
  716.         
  717.             Notes:  DES works with 64 bits (8 bytes) of your data at one
  718.                     time.  We recommend additional steps if your block is
  719.         
  720.         
  721.         
  722.         
  723.                                    Page 11
  724.         
  725.         
  726.         
  727.         
  728.                  (C) Copyright 1994  MaeDae Enterprises
  729.         
  730.                     not exactly an even multiple of 8 bytes long.  One
  731.                     good approach to work around this limitation is to
  732.                     apply one of the conventional encryption methods such
  733.                     as transposition underneath the DES level of
  734.                     encryption.
  735.         
  736.                     Data cannot be encrypted in place when you use the
  737.                     cipher block chaining option.  Because of this, we
  738.                     have to allocate a temporary work buffer from the
  739.                     stack of the same size as the block_length you pass.
  740.                     Please be aware of this and limit your block length
  741.                     to no more that 2048 bytes!
  742.         
  743.         
  744.         
  745.         VOID FAR PASCAL DecryptDESBlockCBC(unsigned char far *block,
  746.           int block_length);
  747.         
  748.             Where:  block - A far pointer to the data you want decrypted.
  749.         
  750.                     block_length - The number of bytes to decrypt at the
  751.                                    location pointed to by block.
  752.         
  753.             Note:  Data cannot be decrypted in place when you use the
  754.                    cipher block chaining option.  Because of this, we
  755.                    have to allocate a temporary work buffer from the
  756.                    stack of the same size as the block_length you pass.
  757.                    Please be aware of this and limit your block length to
  758.                    no more that 2048 bytes!
  759.         
  760.         
  761.         
  762.         unsigned int FAR PASCAL GetVersionWETDES(void);
  763.         
  764.             This function returns the current revision number of WET PRO.
  765.             The format is to return the entire revision as an unsigned
  766.             integer.  For example:  v1.00 would be returned as 100.
  767.         
  768.         
  769.         
  770.         
  771.         
  772.         
  773.         
  774.         
  775.         
  776.         
  777.         
  778.         
  779.         
  780.         
  781.         
  782.         
  783.         
  784.         
  785.         
  786.         
  787.         
  788.         
  789.                                    Page 12
  790.         
  791.         
  792.         
  793.         
  794.                  (C) Copyright 1994  MaeDae Enterprises
  795.         
  796.         General argument descriptions:
  797.         
  798.         
  799.         block - A far pointer to your data to be encrypted/decrypted
  800.         
  801.         block_length - The length of the block you are pointing to
  802.         
  803.         code_key - A zero terminated string containing the phrase to be
  804.                    used for encryption/decryption
  805.         
  806.         key - An eight byte block that contains the DES key for
  807.               encryption/decryption
  808.         
  809.         data_block - An eight byte block that contains the data to be
  810.                      encrypted using DES
  811.         
  812.         
  813.         
  814.         Application notes:
  815.         
  816.         * For XOR, transposition, and substitution, process your data
  817.           once thru the routines to encrypt.  Process the encrypted data
  818.           thru a second time to decrypt.
  819.         
  820.         * DES works with 64 bits (8 bytes) of your data at one time.  We
  821.           recommend additional steps if your block is not exactly an even
  822.           multiple of 8 bytes long.  One good approach to work around this
  823.           limitation is to apply one of the conventional encryption
  824.           methods such as transposition underneath the DES level of
  825.           encryption.
  826.         
  827.         * Data cannot be encrypted in place when you use the DES+cipher
  828.           block chaining.  Because of this, we have to allocate a
  829.           temporary work buffer from the stack of the same size as the
  830.           block_length you pass.  Please be aware of this and limit your
  831.           block length to no more that 2048 bytes!
  832.         
  833.         
  834.         
  835.         
  836.         
  837.         
  838.         
  839.         
  840.         
  841.         
  842.         
  843.         
  844.         
  845.         
  846.         
  847.         
  848.         
  849.         
  850.         
  851.         
  852.         
  853.         
  854.         
  855.                                    Page 13
  856.         
  857.         
  858.         
  859.         
  860.                  (C) Copyright 1994  MaeDae Enterprises
  861.         
  862.         
  863.         HOW TO USE DLLS
  864.         ===============
  865.         
  866.         You can access DLLs in C/C++ using two basic methods.  The
  867.         function prototypes for C access are in WET.H.  WET.HPP contains
  868.         the function prototypes for C++ use.  Basic DLL access methods
  869.         are:
  870.         
  871.         1.  Link an access library into your program.  To do this you
  872.         need to run IMPLIB against the WET DLL(s) to create a .LIB file.
  873.         Add this .LIB file with your other .LIBs for your project.
  874.         Include WET.H into your C module that access WETSTD.DLL or
  875.         WETDES.DLL.  Call the WET functions from your program just as any
  876.         other function.  To use IMPLIB enter the following command at
  877.         your DOS prompt:  IMPLIB WETSTD.LIB WETSTD.DLL
  878.         
  879.         Note:  IMPLIB should be in your path and will probably be located
  880.         in your compiler's BIN subdirectory.
  881.         
  882.         2.  You can access DLLs in C/C++ thru the LoadLibrary command.
  883.         You use the LoadLibrary command to load the DLL and then access
  884.         the functions via GetProcAddress.  When your program finishes
  885.         execution it should unload the DLL via the FreeLibrary command.
  886.         Refer to your compiler vendor's documentation for exact details
  887.         on how to do this.
  888.         
  889.         Many other languages also support DLL function calls.  Refer to
  890.         your manuals for more details on DLL use.
  891.         
  892.         
  893.         
  894.         
  895.         
  896.         
  897.         
  898.         
  899.         
  900.         
  901.         
  902.         
  903.         
  904.         
  905.         
  906.         
  907.         
  908.         
  909.         
  910.         
  911.         
  912.         
  913.         
  914.         
  915.         
  916.         
  917.         
  918.         
  919.         
  920.         
  921.                                    Page 14
  922.         
  923.         
  924.         
  925.         
  926.                  (C) Copyright 1994  MaeDae Enterprises
  927.         
  928.         TUTORIAL (ENCRYPTING/DECRYPTING SAMPLE DATA)
  929.         ============================================
  930.         
  931.         Now let's do something simple to demonstrate how WET works.
  932.         
  933.         All the encryption/decryption functions provided with the standard
  934.         version of WET are used once to encrypt the data.  Then used a
  935.         second time with the same key to decrypt the data.  In C this
  936.         example would look like:
  937.         
  938.         
  939.         #include "WET.H" /* WET.H contains C prototypes for DLLs */
  940.                          /* WET.HPP contains C++ prototypes for DLLs */
  941.         
  942.           char test_data[50];
  943.           int data_length;
  944.         
  945.           lstrcpy(test_data,"This is a test 1234567890");
  946.         
  947.           data_length=strlen(test_data);
  948.         
  949.           EncryptXORBlock(&test_data,data_length,"my key");
  950.         
  951.           /* Test_data now contains the encrypted data */
  952.           /* To decrypt you would use the same function again */
  953.           EncryptXORBlock(&test_data,data_length,"my key");
  954.         
  955.           /* the test_data should now have "This is a test 1234567890" */
  956.         
  957.         
  958.           Notes:  The XOR, transposition, and DES encryption routines
  959.                   alter the data distribution causing 0s to appear at
  960.                   different portions of the encrypted string.  Because of
  961.                   this, we can't use strlen(...) to get the length of the
  962.                   encrypted data.  You need to get the string length
  963.                   before encryption and then refer to that length during
  964.                   the decryption process.
  965.         
  966.                   The WET DLLs were written using the large memory model
  967.                   C/C++ which assumes far data pointers.  To use these
  968.                   DLLs with other memory model programs you must first
  969.                   typecast the data pointers (the char far *block
  970.                   pointer) to be char far * also.
  971.         
  972.         
  973.         The professional version of WET comes provides DES in addition to
  974.         the standard encryption techniques.  The following code fragment
  975.         shows how to use the DES+CBC encryption within a BC++ 4.0
  976.         program.
  977.         
  978.         The majority of our example source code will also work with
  979.         MicroSoft's C/C++ with only minor changes.  Our DLLs are fully
  980.         compatible across a wide range of compilers.  Only the calling
  981.         mechanism varies slightly between the different vendor's
  982.         products.
  983.         
  984.         
  985.         
  986.         
  987.                                    Page 15
  988.         
  989.         
  990.         
  991.         
  992.                  (C) Copyright 1994  MaeDae Enterprises
  993.         
  994.         
  995.         You will notice that for DES+CBC either DESKeyloadEncrypt or
  996.         DESKeyloadDecrypt is called first to load the key.  Then you call
  997.         the encrypt or decrypt function.
  998.         
  999.         When using the DES function without CBC you can just call the
  1000.         appropriate function to load the key and then call CryptDES for
  1001.         both encryption and decryption.  DES+CBC's additional buffer
  1002.         manipulation for cipher block chaining forces a unique encrypt
  1003.         and decrypt functions.
  1004.         
  1005.         
  1006.         
  1007.         Listed below is an example of DES+CBC in C++ code:
  1008.         
  1009.         
  1010.         unsigned char work_string[100];
  1011.         
  1012.         // create a 64 bit key
  1013.         unsigned char use_key[8]={'0','1','2','3','4','5','6','7'};
  1014.         
  1015.         // create a string (0 terminated)
  1016.         // we will encrypt only 1st 16 characters
  1017.         lstrcpy(work_string,"This is a test 0123456789");
  1018.         
  1019.         MessageBox(wndw->HWindow,work_string,
  1020.                    "DES Encryption test - Clear Text",
  1021.                    MB_ICONEXCLAMATION);
  1022.         
  1023.         // Load the 64 bit key into the DES encryption keyload function
  1024.         DESKeyloadEncrypt(use_key);
  1025.         
  1026.         // Encrypt the 1st 16 characters of the block using DES+CBC
  1027.         EncryptDESBlockCBC(work_string,16);
  1028.         
  1029.         MessageBox(wndw->HWindow,work_string,
  1030.                    "DES Encryption test - DES Encrypted (1st 16 char)",MB_ICONEXCLAMATION);
  1031.         
  1032.         // Load the 64 bit key into the DES decryption keyload function
  1033.         DESKeyloadDecrypt(use_key);
  1034.         
  1035.         // Decrypt the first 16 characters of the block using DES+CBC
  1036.         DecryptDESBlockCBC(work_string,16);
  1037.         
  1038.         MessageBox(wndw->HWindow,work_string,
  1039.                    "DES Encryption test - Decrypted",MB_ICONEXCLAMATION);
  1040.         
  1041.         
  1042.         
  1043.         
  1044.         
  1045.         
  1046.         
  1047.         
  1048.         
  1049.         
  1050.         
  1051.         
  1052.         
  1053.                                    Page 16
  1054.         
  1055.         
  1056.         
  1057.         
  1058.                  (C) Copyright 1994  MaeDae Enterprises
  1059.         
  1060.         For DES the core steps would be:
  1061.         
  1062.         DESKeyloadEncrypt(use_key);
  1063.         CryptDES(work_string,16);
  1064.         
  1065.         // 1st 16 characters of the data is now encrypted
  1066.         
  1067.         DESKeyloadDecrypt(use_key);
  1068.         CryptDES(work_string,16);
  1069.         
  1070.         // the entire string is now decrypted
  1071.         
  1072.         
  1073.         
  1074.         An example of using multiple layers of encryption follows.
  1075.         
  1076.           char test_data[50];
  1077.           int data_length;
  1078.           lstrcpy(test_data,"This is a test 1234567890");
  1079.           data_length=strlen(test_data);
  1080.         
  1081.           EncryptXORBlock(&test_data,data_length,"my key");
  1082.           EncryptTranspositionBlock(&test_data,data_length,"my key");
  1083.         
  1084.         // now encrypted two layers deep
  1085.         
  1086.           EncryptTranspositionBlock(&test_data,data_length,"my key");
  1087.           EncryptXORBlock(&test_data,data_length,"my key");
  1088.         
  1089.         // now back to clear text
  1090.         
  1091.         
  1092.         Did you notice that the decryption steps must be the mirror image
  1093.         of the encryption steps?  The encryption layers can be applied in
  1094.         any order or number.  The encryption process can only be reversed
  1095.         as long as you use exactly the same steps in reverse order for
  1096.         decryption process.
  1097.         
  1098.         
  1099.         
  1100.         
  1101.         
  1102.         
  1103.         
  1104.         
  1105.         
  1106.         
  1107.         
  1108.         
  1109.         
  1110.         
  1111.         
  1112.         
  1113.         
  1114.         
  1115.         
  1116.         
  1117.         
  1118.         
  1119.                                    Page 17
  1120.         
  1121.         
  1122.         
  1123.         
  1124.                  (C) Copyright 1994  MaeDae Enterprises
  1125.         
  1126.         CRYPTOGRAPHIC TECHNIQUES
  1127.         ========================
  1128.         
  1129.         Cryptographic techniques provide a very cost effective method of
  1130.         protecting your important data.  There are many computer
  1131.         techniques available today for protecting your sensitive data.
  1132.         WET provides the following four basic encryption methods to help
  1133.         fill these needs:
  1134.         
  1135.         1.  Transposition - Changes the natural order of data so that a
  1136.         different order for the characters is used.  It swaps characters
  1137.         within a message to place them in a different order based on the
  1138.         encryption key (text string) you use for encryption.  For
  1139.         example, "THIS IS A TEST" could become "ISTHA SI  TAEST".  You
  1140.         will notice that the characters are the same.  However, their
  1141.         order is totally mixed up or transposed.  This process is
  1142.         repeated during decryption to return the data back to its
  1143.         original state.
  1144.         
  1145.         2.  Substitution - Substitution is one of the simplest encryption
  1146.         techniques.  It creates a new order for the characters.  For
  1147.         example, the order of the text ABCDEFGHIJKLMNOPQRSTUVWXYZ could
  1148.         be changed to the new order CADMYNZEOFPBQGSRHTUIVWJKXL.  The
  1149.         message "THIS IS A TEST" would then become "IEOU OU C IYUI".
  1150.         This example is simplified for illustration purposes.  When
  1151.         substitution is used within a computer, all 256 possible
  1152.         characters are used so that it is possible to use the technique
  1153.         on different types of computer files.
  1154.         
  1155.         3.  Exclusive Or - This is a logic operation used by the computer
  1156.         to manipulate the data at the bit level.  For example, a
  1157.         character which consists of 10011001 (shown as bits) could be
  1158.         encrypted with 1101010 to give you 01001100 when the exclusive or
  1159.         is performed.  When either the data or the key contains a 1, the
  1160.         result is a 1, otherwise it is a 0.  To reverse the process, you
  1161.         exclusive or the encrypted data with the key a second time.  This
  1162.         operation is very easy for computers to perform and is used when
  1163.         only a minimum of protection is required.
  1164.         
  1165.         4.  Data Encryption Standard (DES) - The professional version of
  1166.         WET also provides DES which performs its encryption by working on
  1167.         a block of 64 bits of your data using a 64 bit key.  DES makes a
  1168.         total of 16 passes through each 8 character (64 bit) block of
  1169.         your data substituting a different character for the one
  1170.         initially there. As you can guess, DES is practically impossible
  1171.         to break.  To eliminate even that small possibility, cipher block
  1172.         chaining (CBC) is often used to strengthen DES.  CBC provides an
  1173.         exclusive or encryption layer underneath DES that chains the
  1174.         encryption of the data from one unencrypted 64 bit block to the
  1175.         next.
  1176.         
  1177.         
  1178.         
  1179.         
  1180.         
  1181.         
  1182.         
  1183.         
  1184.         
  1185.                                    Page 18
  1186.         
  1187.         
  1188.         
  1189.         
  1190.                  (C) Copyright 1994  MaeDae Enterprises
  1191.         
  1192.         ENCRYPTED RAMBLINGS - SOME GOOD INFORMATION
  1193.         ===========================================
  1194.         
  1195.         As networks proliferate, the need for data security increases.
  1196.         The world in the past has largely depended on physical security,
  1197.         that is safes and locks.  Computers, much to everyone's
  1198.         consternation, are rapidly eroding the possibility of physical
  1199.         security (wherever a modem is connected to a phone line).  Laws
  1200.         will be passed, but in the final result, honesty depends on good
  1201.         locks and all the ministrations of legislators and bureaucrats
  1202.         will have little positive effect on security.  Human nature will
  1203.         win out.  The easier it is to get, the more likely it is to be
  1204.         stolen.  Encryption provides part of the answer to the need for
  1205.         increased security.  It is especially useful in systems that are
  1206.         open to all users but which have some confidential data. Instead
  1207.         of complex levels of user verification through passwords,
  1208.         everyone can get the file but only the people with the key can
  1209.         decode the information. Encryption in its present state is
  1210.         cumbersome and time consuming but, faster computers and better
  1211.         programs can ease this problem.  This is where WET comes to the
  1212.         rescue.
  1213.         
  1214.         Encryption is a fascinating exercise and is considered
  1215.         unbreakable if two conditions are met.  First, the key is longer
  1216.         than the message and second, the key is only used once, sometimes
  1217.         called a "one time pad."  Typically the files you will be
  1218.         encrypting are much longer than the key (also much longer than
  1219.         the one we build from your key) thereby weakening the encryption.
  1220.         
  1221.         Distribution and maintenance of keys is unworkable in the day-to-
  1222.         day operation of any communications operation of any size.
  1223.         WET builds a much more complex key in its substitution encryption
  1224.         method from your simple key, in an effort to provide a means to
  1225.         ease this problem.  It creates a one time pad based on your
  1226.         unique key.  Most random keys are not truly random since all
  1227.         random functions are repeatable and their true randomness is
  1228.         somewhat suspect.  What is the solution?  The specter of bigger
  1229.         and faster computers looms in the future to provide even faster
  1230.         encryption.  Thinkers build on the best thoughts of those
  1231.         preceding them.  More powerful computers and better encryption
  1232.         techniques will eventually provide a good solution to this
  1233.         problem.
  1234.         
  1235.         WET provides encryption methods that range from the fairly
  1236.         secure to the very secure.  Choose the level of protection you
  1237.         need for your sensitive data.  You can even apply all the
  1238.         different encryption techniques to your data one level after
  1239.         another.  This further complicates the process of breaking the
  1240.         code making it virtually impossible.
  1241.         
  1242.         The best encryption in the world won't protect your data if you
  1243.         give away the key.  Secure encryption of the data is our job.
  1244.         The choice of a good key and its protection is your job.
  1245.         
  1246.         How do you select a good key?  Several things should be
  1247.         
  1248.         
  1249.         
  1250.         
  1251.                                    Page 19
  1252.         
  1253.         
  1254.         
  1255.         
  1256.                  (C) Copyright 1994  MaeDae Enterprises
  1257.         
  1258.         considered. The key should not have a lot of repeating
  1259.         characters.  If they have any pattern to the eye they should not
  1260.         be used.  Keys should be kept secure.
  1261.         
  1262.         WET supports keys of any length for the standard levels of
  1263.         encryption.  We recommend you use as long a key as practical.
  1264.         Phrases or short sentences should work well as the key and still
  1265.         be easy to remember.  Spaces may be used in your key, but we
  1266.         recommend not using spaces at the beginning or end of the key.
  1267.         These spaces are easily forgotten.
  1268.         
  1269.         NOTE:  If there is any question about the randomness of the
  1270.         encrypted data, WET could be used on it multiple times
  1271.         using different keys and different techniques.  The true
  1272.         randomness of the key should not matter since the use of more
  1273.         than one key should make unraveling very difficult, if not
  1274.         impossible.  This process could be repeated until the paranoia of
  1275.         the person generating the keys was satisfied.
  1276.         
  1277.         
  1278.         
  1279.         
  1280.         
  1281.         
  1282.         
  1283.         
  1284.         
  1285.         
  1286.         
  1287.         
  1288.         
  1289.         
  1290.         
  1291.         
  1292.         
  1293.         
  1294.         
  1295.         
  1296.         
  1297.         
  1298.         
  1299.         
  1300.         
  1301.         
  1302.         
  1303.         
  1304.         
  1305.         
  1306.         
  1307.         
  1308.         
  1309.         
  1310.         
  1311.         
  1312.         
  1313.         
  1314.         
  1315.         
  1316.         
  1317.                                    Page 20
  1318.         
  1319.         
  1320.         
  1321.         
  1322.                  (C) Copyright 1994  MaeDae Enterprises
  1323.         
  1324.         BASIC DEFINITIONS:
  1325.         ==================
  1326.         
  1327.         The terms used in WET and cryptography in general may be a
  1328.         little confusing.  Listed below are terms frequently used when
  1329.         discussing cryptography.  We have tried to pick a handful of the
  1330.         most important terms and define them for you.  They are:
  1331.         
  1332.         Data Encryption Standard (DES) - The Data Encryption Standard was
  1333.         issued by the U.S. National Bureau of Standards.  The National
  1334.         Security Agency (NSA) was intimately involved in the development
  1335.         and acceptance testing of the algorithm.  DES performs its
  1336.         encryption by working on a block of 64 bits of your data using a
  1337.         64 bit key.  Basically, DES is a substitution cipher.
  1338.         
  1339.         Cryptography -- The general study of hiding the meaning of
  1340.         messages and the general techniques used for the hiding.
  1341.         
  1342.         Cryptanalysis -- The solving or breaking of codes without any
  1343.         knowledge of the key.
  1344.         
  1345.         Cipher -- Any technique, method, or scheme (substitution,
  1346.         transposition, and XOR) used to encrypt and decrypt text,
  1347.         without regard to its linguistic structure.
  1348.         
  1349.         Plaintext -- The unencrypted or totally decrypted readable text.
  1350.         
  1351.         Ciphertext -- The unintelligible text, after encrypting it.
  1352.         
  1353.         Cipher Block Chaining -- This is an additional layer of
  1354.         encryption beneath DES.  It is typically an extra XOR layer that
  1355.         chains the results of one block of data to the next.  Usually
  1356.         this involves encrypting the current block of data using the
  1357.         plaintext contents of the previous block as the key.
  1358.         
  1359.         Encrypting -- The process of encoding/encrypting a plaintext file
  1360.         to hide the intelligence.
  1361.         
  1362.         Decrypting -- Decoding an encrypted/ciphertext file.
  1363.         
  1364.         Key -- The text used to encrypt or decrypt a file.  Sometimes
  1365.         called a code word.  Keys can be simple everyday words or very
  1366.         complex combinations of characters that have no meaning.  Some
  1367.         electronic information services pick your password by combining
  1368.         two regular words with a character between them.  Examples keys:
  1369.         abc,1234 and Never:Again.
  1370.         
  1371.         
  1372.         
  1373.         
  1374.         
  1375.         
  1376.         
  1377.         
  1378.         
  1379.         
  1380.         
  1381.         
  1382.         
  1383.                                    Page 21
  1384.         
  1385.         
  1386.         
  1387.